Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the function pointer docs #98180

Merged
merged 3 commits into from
Jul 19, 2022
Merged

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Jun 16, 2022

This is #97842 but for function pointers instead of tuples. The concept is basically the same.

  • Reduce duplicate impls; show fn (T₁, T₂, …, Tₙ) and include a sentence saying that there exists up to twelve of them.
  • Show Copy and Clone.
  • Show auto traits like Send and Sync, and blanket impls like Any.

https://notriddle.com/notriddle-rustdoc-test/std/primitive.fn.html

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 16, 2022
@rust-highfive
Copy link
Collaborator

Some changes occurred in clean/types.rs.

cc @camelid

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Collaborator

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 16, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@notriddle notriddle force-pushed the notriddle/rustdoc-fn branch from 75568c8 to 97dd790 Compare July 4, 2022 04:14
@rustbot
Copy link
Collaborator

rustbot commented Jul 4, 2022

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@bors

This comment was marked as resolved.

The attribute is also renamed `fake_variadic`.
@GuillaumeGomez
Copy link
Member

Just looked at your hosted docs and saw this:

Screenshot from 2022-07-18 11-14-36

Not sure if it comes from this PR or not though. If not, I'll resume the review and open an issue. :)

@notriddle
Copy link
Contributor Author

That’s unfortunate, and I’m not sure what the right solution is, but it’s needed to signal that the impl:

  • is an impl for C-style variadic functions
  • supports an arbitrary number of non-variadic arguments

Both, at the same time.

@GuillaumeGomez
Copy link
Member

It's so weird. I don't think we can do better or at least I don't see how. Would be nice if we could also improve the sidebar items because having the same one multiple times isn't great (but not part of this PR).

@GuillaumeGomez
Copy link
Member

Looks good to me, thanks! I'd just like to have someone from the compiler to confirm the changes on their side before approving it though. I'll let you ping someone from their team.

@notriddle
Copy link
Contributor Author

r? rust-lang/compiler

@petrochenkov
Copy link
Contributor

r=me after squashing commits.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 19, 2022
@notriddle notriddle force-pushed the notriddle/rustdoc-fn branch from a60af82 to da9869f Compare July 19, 2022 15:51
* Reduce duplicate impls; show only the `fn (T)` and include a sentence
  saying that there exists up to twelve of them.
* Show `Copy` and `Clone`.
* Show auto traits like `Send` and `Sync`, and blanket impls like `Any`.
@notriddle notriddle force-pushed the notriddle/rustdoc-fn branch from da9869f to ddb5a26 Compare July 19, 2022 15:52
@notriddle
Copy link
Contributor Author

@bors r=petrochenkov,GuillaumeGomez rollup=never

@bors
Copy link
Contributor

bors commented Jul 19, 2022

📌 Commit ddb5a26 has been approved by petrochenkov,GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 19, 2022
@bors
Copy link
Contributor

bors commented Jul 19, 2022

⌛ Testing commit ddb5a26 with merge 9a7b7d5...

@bors
Copy link
Contributor

bors commented Jul 19, 2022

☀️ Test successful - checks-actions
Approved by: petrochenkov,GuillaumeGomez
Pushing 9a7b7d5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 19, 2022
@bors bors merged commit 9a7b7d5 into rust-lang:master Jul 19, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 19, 2022
@notriddle notriddle deleted the notriddle/rustdoc-fn branch July 20, 2022 00:13
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9a7b7d5): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
0.2% 0.3% 3
Regressions 😿
(secondary)
0.4% 0.4% 8
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-1.2% -1.2% 1
All 😿🎉 (primary) 0.2% 0.3% 3

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
1.4% 1.4% 1
Improvements 🎉
(primary)
-3.2% -3.2% 1
Improvements 🎉
(secondary)
-2.2% -2.3% 2
All 😿🎉 (primary) -3.2% -3.2% 1

Cycles

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
2.5% 2.8% 2
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 2.5% 2.8% 2

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added the perf-regression Performance regression. label Jul 20, 2022
@pnkfelix
Copy link
Member

The regressions above are all in doc generation, and they are all minor.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jul 27, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 26, 2023
…ke-variadic, r=notriddle

rustdoc: Remove space from fake-variadic fn ptr impls

before: `for fn (T₁, T₂, …, Tₙ) -> Ret`
after: `for fn(T₁, T₂, …, Tₙ) -> Ret`

I don't think we usually have spaces there, so it looks weird.

cc `@notriddle` since you added the space in rust-lang#98180 (or rather, added the feature with a space included).
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2023
…-variadic, r=notriddle

rustdoc: Remove space from fake-variadic fn ptr impls

before: `for fn (T₁, T₂, …, Tₙ) -> Ret`
after: `for fn(T₁, T₂, …, Tₙ) -> Ret`

I don't think we usually have spaces there, so it looks weird.

cc `@notriddle` since you added the space in rust-lang#98180 (or rather, added the feature with a space included).
bors added a commit to rust-lang/miri that referenced this pull request Nov 30, 2023
…, r=notriddle

rustdoc: Remove space from fake-variadic fn ptr impls

before: `for fn (T₁, T₂, …, Tₙ) -> Ret`
after: `for fn(T₁, T₂, …, Tₙ) -> Ret`

I don't think we usually have spaces there, so it looks weird.

cc `@notriddle` since you added the space in rust-lang/rust#98180 (or rather, added the feature with a space included).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants